ifneq ($(KERNELRELEASE),)
TARGET=random
obj-m += $(TARGET).o
$(TARGET)-objs =
ccflags-y += -DDEBUG
else

CTL_TARGET=randctl
CTL_SRC=randctl.c


KERNELDIR=/lib/modules/$(shell uname -r)/build
PWD=$(shell pwd)

default:
	make -C $(KERNELDIR) SUBDIRS=$(PWD) modules
clean:
	make -C $(KERNELDIR) SUBDIRS=$(PWD) clean
ctl:
	gcc $(CTL_SRC) -o $(CTL_TARGET)
ctl-clean:	
	rm -rf $(CTL_TARGET)
endif	
